package jobflow.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity(name="adres")
@Table(name="ADRES")
public class Adres implements Serializable {

	/**
	 */
	private static final long serialVersionUID = 1L;

	private Long id;
	private String sokak;		
	private String cadde;  
	private String apartmanAdi;	
	private String daireNo;	
	private String kapiNo;	
	private Calisan calisan = new Calisan();
	
	@Id
	@GeneratedValue
	@Column(name="ID")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	@Column(name="SOKAK",nullable=true)
	public String getSokak() {
		return sokak;
	}

	public void setSokak(String sokak) {
		this.sokak = sokak;
	}
	@Column(name="CADDE",nullable=true)
	public String getCadde() {
		return cadde;
	}

	public void setCadde(String cadde) {
		this.cadde = cadde;
	}
	@Column(name="APARTMAN_ADI",nullable=true)
	public String getApartmanAdi() {
		return apartmanAdi;
	}

	public void setApartmanAdi(String apartmanAdi) {
		this.apartmanAdi = apartmanAdi;
	}
	@Column(name="DAIRE_NO",nullable=true)
	public String getDaireNo() {
		return daireNo;
	}

	public void setDaireNo(String daireNo) {
		this.daireNo = daireNo;
	}
	@Column(name="KAPI_NO",nullable=true)
	public String getKapiNo() {
		return kapiNo;
	}

	public void setKapiNo(String kapiNo) {
		this.kapiNo = kapiNo;
	}


//	public void setCalisanList(List<Calisan> calisanList) {
//		this.calisanList = calisanList;
//	}
//    @OneToMany(mappedBy="adres",fetch=FetchType.LAZY)
//	public List<Calisan> getCalisanList() {
//		return calisanList;
//	}

	public void setCalisan(Calisan calisan) {
		this.calisan = calisan;
	}
    @ManyToOne(cascade=CascadeType.PERSIST,fetch=FetchType.EAGER)
    @JoinColumn(name="CALISAN_ID")
	public Calisan getCalisan() {
		return calisan;
	}
    


		
	




}
